#include <iostream>
using namespace std; //don't wang ";"
int main()
{
    int y, m, d;
	char yn;
	int msg[12] = {
		31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
	};
	
	//yong do-while shixian rang yonghu zhongzhi chengxu.
	do
	{
	cout << "please input year,month,date:" << endl;
	cin >> y >> m >> d;
	
		//pai duan shi bu shi runnian hai shi pingnian	
	if (y%4==0 && y%100!=0 || y%400==0)
	{
		msg[1] = 29;
	}
	else 
	{
		msg[1] = 28;
	}

		int s=0;
	for (int i=0;i<m-1;i++)
	
	{
		s += msg[i];
	} 
	s = s + d;
	
	cout << "di " << s << " tian" << endl; //shuchu duoshao tian.
	cout << "please input year,month,date(n is stop):" << endl;	//xunweu yonghu shifu zaici churu.
	cin >> yn;	
    }while (yn != 'n' && yn != 'N');//manzu (yn != 'n' && yn != 'N') jiu jixu zhixing do xunhuan.
	return 0;
} 
